 
package com.mixide.ui.part;

import javax.inject.Inject;
import javax.annotation.PostConstruct;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;

import com.mixide.ui.service.MixHolder;

public class OverflowPart {
	
	private Display display;
	private MixHolder mix;
	
	public @Inject OverflowPart(Display display, MixHolder mix) {
		this.display = display;
		this.mix = mix;
	}
	
	@PostConstruct
	public void postConstruct(Composite parent) {
		parent.setBackground(this.display.getSystemColor(SWT.COLOR_WHITE));
		GridLayout layout = new GridLayout(2, false);
		parent.setLayout(layout);
		Button yes = new Button(parent, SWT.TOGGLE);
		yes.setText("YES");
		Button no = new Button(parent, SWT.TOGGLE);
		no.setText("NO");
		
		if (this.mix.overflow().isOpen()) {
			yes.setSelection(true);
		} else {
			no.setSelection(true);
		}
	}
}